/**
 * 启动APP入口
 * https://github.com/facebook/react-native
 * @flow
 */
import React, { Component } from 'react'
import {AsyncStorage} from 'react-native'
import {bindActionCreators} from 'redux'
import {connect} from 'react-redux'
import * as creationActions from '../actions/creaction'
import TooScreen from '../components/Entrance/Tools/toolScreen'
//import Boot from '../components/booted'
//import RootNavigator from './test/main'
//本地数据抹除
//AsyncStorage.multiRemove(['entered','user'])


class createContainer extends Component{
  constructor(props){
    super(props)

  }
  componentDidMount() {
    //this.props.fetchCreactions()
  }
  render() {
    return(
      <TooScreen
        {...this.props}
      />
    )
  }
}
//获取基础属性
function mapStateToProps(state){
  const {
    user
  } = state.get('app')
  const {
    isRefreshing,
    isLoadingTail,
    videoList,
    videoTotal,
    popup,
    page
  } = state.get('creations')
  return {
    isRefreshing,
    isLoadingTail,
    videoList,
    videoTotal,
    popup,
    page,
    user
  }
}
//所有的参数进行绑定传递给这个组件
function mapDispatchToProps(dispatch){
  return bindActionCreators(creationActions,dispatch)
}

export default connect(mapStateToProps,mapDispatchToProps)(createContainer)